home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / Programming / Source / winterp-1.13 / src-server / wc_CascadeB.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-10-04  |  5.5 KB  |  146 lines

  1. /* -*-C-*-
  2. ********************************************************************************
  3. *
  4. * File:         wc_CascadeB.c
  5. * RCS:          $Header: wc_CascadeB.c,v 1.4 91/03/14 03:14:29 mayer Exp $
  6. * Description:  XM_CASCADE_BUTTON_WIDGET_CLASS/CASCADE_BUTTON_GADGET_CLASS
  7. * Author:       Niels Mayer, HPLabs
  8. * Created:      Fri Oct 27 21:54:13 1989
  9. * Modified:     Thu Oct  3 23:56:51 1991 (Niels Mayer) mayer@hplnpm
  10. * Language:     C
  11. * Package:      N/A
  12. * Status:       X11r5 contrib tape release
  13. *
  14. * WINTERP Copyright 1989, 1990, 1991 Hewlett-Packard Company (by Niels Mayer).
  15. * XLISP version 2.1, Copyright (c) 1989, by David Betz.
  16. *
  17. * Permission to use, copy, modify, distribute, and sell this software and its
  18. * documentation for any purpose is hereby granted without fee, provided that
  19. * the above copyright notice appear in all copies and that both that
  20. * copyright notice and this permission notice appear in supporting
  21. * documentation, and that the name of Hewlett-Packard and David Betz not be
  22. * used in advertising or publicity pertaining to distribution of the software
  23. * without specific, written prior permission.  Hewlett-Packard and David Betz
  24. * make no representations about the suitability of this software for any
  25. * purpose. It is provided "as is" without express or implied warranty.
  26. *
  27. * HEWLETT-PACKARD AND DAVID BETZ DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
  28. * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
  29. * IN NO EVENT SHALL HEWLETT-PACKARD NOR DAVID BETZ BE LIABLE FOR ANY SPECIAL,
  30. * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  31. * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  32. * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  33. * PERFORMANCE OF THIS SOFTWARE.
  34. *
  35. * See ./winterp/COPYRIGHT for information on contacting the authors.
  36. * Please send modifications, improvements and bugfixes to mayer@hplabs.hp.com
  37. * Post XLISP-specific questions/information to the newsgroup comp.lang.lisp.x
  38. *
  39. ********************************************************************************
  40. */
  41. static char rcs_identity[] = "@(#)$Header: wc_CascadeB.c,v 1.4 91/03/14 03:14:29 mayer Exp $";
  42.  
  43. #include <stdio.h>
  44. #include <Xm/Xm.h>
  45. #include <Xm/CascadeB.h>
  46. #include <Xm/CascadeBG.h>
  47. #include "winterp.h"
  48. #include "user_prefs.h"
  49. #include "xlisp/xlisp.h"
  50. #include "w_funtab.h"
  51.  
  52. extern Widget Wcls_Get_WIDGETOBJ_Argument_Returning_Validated_WidgetID(); /* w_classes.c */
  53.  
  54. /******************************************************************************
  55.  * (send <cascadebuttonwidget> :highlight <highlight_p>)
  56.  *    ==> returns <cascadebuttonwidget>
  57.  *
  58.  * This method draws the shadow higlight around the cascadebutton if
  59.  * <highlight_p> is true, and unhighlights if <highlight_p> is NIL.
  60.  * 
  61.  * void XmCascadeButtonHighlight (cb, highlight)
  62.  * Widget cb;
  63.  * Boolean highlight;
  64.  ******************************************************************************/
  65. LVAL Xm_Cascade_Button_Widget_Class_Method_HIGHLIGHT()
  66. {
  67.   LVAL self, highlight_p;
  68.   Widget widget_id;
  69.  
  70.   widget_id = Wcls_Get_WIDGETOBJ_Argument_Returning_Validated_WidgetID(&self);
  71.   highlight_p = xlgetarg();
  72.   xllastarg();
  73.   
  74.   XmCascadeButtonHighlight(widget_id, (highlight_p) ? TRUE : FALSE);
  75.   
  76.   return (self);
  77. }
  78.  
  79.  
  80. #ifdef WINTERP_MOTIF_11
  81. /******************************************************************************
  82.  * (send <cascadebuttongadget> :highlight <highlight_p>)
  83.  *    ==> returns <cascadebuttonwidget>
  84.  *
  85.  * This method draws the shadow higlight around the cascadebutton if
  86.  * <highlight_p> is true, and unhighlights if <highlight_p> is NIL.
  87.  * 
  88.  * void XmCascadeButtonGadgetHighlight (Widget cb, Boolean highlight)
  89.  ******************************************************************************/
  90. LVAL Xm_Cascade_Button_Gadget_Class_Method_HIGHLIGHT()
  91. {
  92.   LVAL self, highlight_p;
  93.   Widget widget_id;
  94.  
  95.   widget_id = Wcls_Get_WIDGETOBJ_Argument_Returning_Validated_WidgetID(&self);
  96.   highlight_p = xlgetarg();
  97.   xllastarg();
  98.   
  99.   XmCascadeButtonGadgetHighlight(widget_id, (highlight_p) ? TRUE : FALSE);
  100.  
  101.   return (self);
  102. }
  103. #endif /* WINTERP_MOTIF_11 */
  104.  
  105.  
  106. /******************************************************************************
  107.  *
  108.  ******************************************************************************/
  109. Wc_CascadeB_Init()
  110. {
  111.   LVAL o_XM_CASCADE_BUTTON_WIDGET_CLASS;
  112.   LVAL o_XM_CASCADE_BUTTON_GADGET_CLASS;
  113.   extern LVAL Wcls_Create_Subclass_Of_WIDGET_CLASS(); /* w_classes.c */
  114.   extern      xladdmsg();    /* from xlobj.c */
  115.  
  116.   o_XM_CASCADE_BUTTON_WIDGET_CLASS =
  117.     Wcls_Create_Subclass_Of_WIDGET_CLASS("XM_CASCADE_BUTTON_WIDGET_CLASS",
  118.                      xmCascadeButtonWidgetClass);
  119.  
  120.   xladdmsg(o_XM_CASCADE_BUTTON_WIDGET_CLASS, ":HIGHLIGHT",
  121.        FTAB_Xm_Cascade_Button_Widget_Class_Method_HIGHLIGHT);
  122.  
  123.   o_XM_CASCADE_BUTTON_GADGET_CLASS =
  124.     Wcls_Create_Subclass_Of_WIDGET_CLASS("XM_CASCADE_BUTTON_GADGET_CLASS",
  125.                      xmCascadeButtonGadgetClass);
  126.  
  127. #ifdef WINTERP_MOTIF_11
  128.   xladdmsg(o_XM_CASCADE_BUTTON_GADGET_CLASS, ":HIGHLIGHT",
  129.        FTAB_Xm_Cascade_Button_Gadget_Class_Method_HIGHLIGHT);
  130. #else                /* MOTIF 1.0 */
  131.   xladdmsg(o_XM_CASCADE_BUTTON_GADGET_CLASS, ":HIGHLIGHT",
  132.        FTAB_Xm_Cascade_Button_Widget_Class_Method_HIGHLIGHT);
  133. #endif                /* WINTERP_MOTIF_11 */
  134.  
  135. #ifdef WINTERP_MOTIF_11
  136.   /*
  137.    * share this method w/ XmRowColumn... see 
  138.    * wc_RowColumn.c:Xm_Row_Column_Widget_Class_Method_GET_SUB_MENU_WIDGET()
  139.    * for details
  140.    */
  141.   xladdmsg(o_XM_CASCADE_BUTTON_GADGET_CLASS, ":GET_SUB_MENU_WIDGET",
  142.        FTAB_Xm_Row_Column_Widget_Class_Method_GET_SUB_MENU_WIDGET);
  143. #endif                /* WINTERP_MOTIF_11 */
  144. }
  145.